package singleList;

public class Test01 {
    public static void test01(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.addFirst(99);
        mySingleList.addLast(99);
        mySingleList.display();
        mySingleList.display(mySingleList.head.getNext());
    }

    public static void test02(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.display();
        System.out.println(mySingleList.size());
        mySingleList.addIndex(3,9);
        System.out.println(mySingleList.contains(9));
        System.out.println(mySingleList.contains(2));
        mySingleList.display();
    }

    public static void test03(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.display();
        mySingleList.addIndex(3,9);
        mySingleList.remove(9);
        mySingleList.remove(7);
        mySingleList.display();
    }
    public static void test04(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.display();
        mySingleList.addIndex(0,9);
        mySingleList.addIndex(0,9);
        mySingleList.addLast(9);
        mySingleList.display();

        mySingleList.removeAllKey(9);
        mySingleList.display();
    }
    public static void test05(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.display();
        mySingleList.reverse();
        mySingleList.display();

    }
    public static void test06(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.display();
        System.out.println(mySingleList.middleNode(mySingleList.head).getVal());
        System.out.println();
        mySingleList.display();

    }

    public static void test07(){
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        mySingleList.display();
        System.out.println(mySingleList.KthToLast(3));

    }
    public static void test08(){


    }
    public static void main(String[] args) {
//        test01();
//        test02();
//        test03();
//        test04();
//        test05();
//        test06();
        test07();
    }
}
